package com.example.rabbitmqspringbootdemo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController()
@RequestMapping("/rabbitmq")
public class ControllerDemo {
    @Autowired
     Producer producer;

    @Autowired
    AdvancedProducer advancedProducer;


    @GetMapping("/simple" )
    public String simpleSender(){
       producer.simpleProducer();
        return "simple send Message";
    }

    @GetMapping("/simplercv" )
    public String simpleReceiver(){
        producer.simpleReceive();
        return "simple receive Message";
    }
    @GetMapping("/work" )
    public String workSender(){
        producer.workProducer();
        return "work Message";
    }

    @GetMapping("/direct" )
    public String directSender(){
        producer.directProducer();
        return "direct Message";
    }

    @GetMapping("/fanout" )
    public String fanoutSender(){
        producer.fanoutProducer();
        return "fanout Message";
    }

    @GetMapping("/topic" )
    public String topicSender(){
        producer.topicProducer();
        return "topic Message";
    }

    @GetMapping("/tx" )
    public String transactionSender(){
        advancedProducer.transactionProducer();
        return "transaction Message";
    }

    @GetMapping("/confirm")
    public String confirmSender(){
        advancedProducer.confirmProducer();
        return "confirm Message";
    }

    @GetMapping("/ack")
    public String ackSender(){
        advancedProducer.ackProducer();
        return "ack Message";
    }

    @GetMapping("/limit")
    public String limitSender(){
        advancedProducer.limitProducer();
        return "limit Message";
    }

    @GetMapping("/durable")
    public String durableSender(){
        advancedProducer.durableProducer();
        return "durable Message";
    }

    @GetMapping("/dead")
    public String deadSender(){
        advancedProducer.deadProducer();
        return "dead Message";
    }

    @GetMapping("/delay")
    public String delaySender(){
        advancedProducer.delayProducer();
        return "delay Message";
    }


}
